<script>

// 1、let声明变量
{
    var a = 1
    let b = 2
}
// console.log(a)
// console.log(b) Uncaught ReferenceError: b is not defined at test.html:9

//2.let只能声明一次

{
    var a  = 2
    var a = 3
    let b = 1
  //  let b = 4 //Uncaught SyntaxError: Identifier 'b' has already been declared
}

//3.const声明常量（只读变量） 同时必须初始化
const PI =  "3.1415926"
PI = 3 // test.html:22 Uncaught TypeError: Assignment to constant variable. 给常量赋值
// const str //Uncaught SyntaxError: Missing initializer in const declaration
</script>
